Skip to content

Conversation

pierric
Copy link

@pierric pierric commented Dec 15, 2018

Here is a bug. It happens when pretty print a promoted list or tuple of promoted type. For example:

Prelude Language.Haskell.Exts Language.Haskell.Exts.Syntax Language.Haskell.Exts.Pretty> a = TyPromoted () (PromotedList () True [TyPromoted () (PromotedTuple () [])])
Prelude Language.Haskell.Exts Language.Haskell.Exts.Syntax Language.Haskell.Exts.Pretty> prettyPrint a
"'['()]"

However GHC (8.4.4) does not accept '['()]

A.hs:4:10: error: parse error on input ‘'’
  |
4 | type X = '['()]
  |          ^

So I add one space after the bracket when pretty print. The above example will become "'[ '()]", which makes GHC very happy.

@pierric
Copy link
Author

pierric commented May 1, 2019

any idea about this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant